home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Simpsons Cartoon Studio™ Demo / Simpdata / simpmain / 00015_foregroundFXRecordManager parent.ls < prev    next >
Encoding:
Text File  |  1996-09-06  |  2.6 KB  |  84 lines

  1. property ancestor
  2. global theLayer, foregroundFXSpr, theStageBounds, currentFrame, frameLimit, dirtyFlag
  3.  
  4. on birth me
  5.   set the ancestor of me to birth(script "recordMethods parent")
  6.   return me
  7. end
  8.  
  9. on record me
  10.   set theLayer to foregroundFXSpr
  11.   buildFilterList(me)
  12.   set theFXType to getAt(curClipRecord, 1)
  13.   set fgdFXName to getAt(curClipRecord, 2)
  14.   set loopList to getAt(curClipRecord, 5)
  15.   set firstClip to getAt(loopList, 1)
  16.   set the castNum of sprite foregroundFXSpr to firstClip
  17.   preLoadCast(getAt(loopList, 1), getLast(loopList))
  18.   if theFXType = "X" then
  19.     set the loc of sprite foregroundFXSpr to point(the mouseH, the mouseV)
  20.     updateStage()
  21.     cursor(200)
  22.     repeat while the mouseUp
  23.       moveRecordingSpr(me, foregroundFXSpr, the mouseH, the mouseV)
  24.     end repeat
  25.   else
  26.     set the loc of sprite foregroundFXSpr to point(313, 218)
  27.     updateStage()
  28.     cursor(-1)
  29.     repeat while the mouseUp
  30.     end repeat
  31.   end if
  32.   set theMouseH to the mouseH
  33.   set theMouseV to the mouseV
  34.   set theMouseLoc to point(theMouseH, theMouseV)
  35.   if inside(theMouseLoc, theStageBounds) or the shiftDown then
  36.     if theFXType = "T" then
  37.       set theMouseH to 313
  38.       set theMouseV to 218
  39.     end if
  40.     set countFgdFXData to count(fgdFXData)
  41.     if countFgdFXData < currentFrame then
  42.       repeat with theFrameNumber = countFgdFXData + 1 to currentFrame
  43.         append(fgdFXData, copyList([]))
  44.       end repeat
  45.     end if
  46.     set overFlow to 0
  47.     repeat with theClipNumber = 1 to count(loopList)
  48.       if currentFrame < frameLimit then
  49.         if currentFrame > count(scoreData) then
  50.           setAt(scoreData, currentFrame, copyList(autoHoldFrame))
  51.         end if
  52.         set the loc of sprite foregroundFXSpr to point(theMouseH, theMouseV)
  53.         set theClip to getAt(loopList, theClipNumber)
  54.         set the castNum of sprite foregroundFXSpr to theClip
  55.         set currentFrameData to list(theClip, theMouseH, theMouseV, fgdFXName)
  56.         setAt(fgdFXData, currentFrame, currentFrameData)
  57.         showFrame(playbackMgr, currentFrame, foregroundFXSpr)
  58.         setKrusty(playbackMgr)
  59.         incrementFrame()
  60.         next repeat
  61.       end if
  62.       set overFlow to 1
  63.       exit repeat
  64.     end repeat
  65.     if overFlow then
  66.       showOverFlowDialog(me)
  67.     end if
  68.     cursor(4)
  69.     extendClips(me)
  70.     if currentFrame > 1 then
  71.       decrementFrame()
  72.     end if
  73.     setKrusty(playbackMgr)
  74.     showFrame(playbackMgr, currentFrame, 0)
  75.     set dirtyFlag to 1
  76.     updateTheBrain(appMgr)
  77.     cursor(-1)
  78.   else
  79.     hideRecordingSpr(me, foregroundFXSpr)
  80.     showFrame(playbackMgr, currentFrame, 0)
  81.     cursor(-1)
  82.   end if
  83. end
  84.